package com.five.service.impl;

import com.five.dao.TravelMapper;
import com.five.entity.Travel;
import com.five.service.TravelService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created by Administrator on 2018/2/27.
 */
@Service("TravelService")
public class TravelServiceImpl implements TravelService {

    @Autowired
    private TravelMapper travelMapper;

    @Override
    public void addTravel(Travel travel) {
        travelMapper.insertSelective(travel);
    }

    @Override
    public Travel selectByPrimaryKey(Integer id) {
        return travelMapper.selectByPrimaryKey(id);
    }

    @Override
    public void updateCommentsId(Travel travel) {
        travelMapper.updateByPrimaryKeySelective(travel);
    }

    @Override
    public List<Travel> selectByUserId(Integer userId) {
        return travelMapper.selectByUserId(userId);
    }

    @Override
    public List<Travel> selectAll() {
        return travelMapper.selectAll();
    }
}
